<?php

namespace Common\Model;

/**
 * SettingModel.class实例模型
 * 
 * @author songanwei
 * @date 2016-3-23
 */
class SettingModel extends BaseModel {

    protected $trueTableName = 'tb_setting';

    /**
     * 更新数据
     * @modify songanwei 2016-03-23
     * @param integer $id 主键ID
     * @param string $mobile 手机号
     * @param string $defaultString 打印二维码默认字符串
     * @return type
     */
    public function saveInfo($id, $mobile = null, $defaultString = null) {
        $data = array();
        if (!is_null($mobile)) {
            $data['mobile'] = $mobile;
        }
        if (!is_null($defaultString)) {
            $data['printdefaultstring'] = $defaultString;
        }

        $result = $this->where(array('id' => $id))->save($data);
        return $result === false ? false : true;
    }
}
